package com.audaque.springboot.foshanupload.core.exception;


import com.audaque.springboot.foshanupload.core.enums.ResultCodeEnum;
import lombok.*;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper=false)
@Data
@NoArgsConstructor
public class RetryMaxException extends RuntimeException {

    private Integer errcode;

    public RetryMaxException(String message, Integer code) {
        super(message);
        this.errcode = errcode;
    }

    public RetryMaxException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getDescription());
        this.errcode = resultCodeEnum.getStatus();
    }

    public RetryMaxException(ResultCodeEnum resultCodeEnum, String message, Object... args) {
        super(String.format(message, args));
        this.errcode = resultCodeEnum.getStatus();
    }

    public RetryMaxException(String message, Object... args) {
        super(String.format(message, args));
        this.errcode = ResultCodeEnum.FAILE.getStatus();
    }


}
